import { NavBar, Icon } from 'antd-mobile'
import {withRouter} from 'react-router-dom'
import PropTypes from 'prop-types'
import './index.scss'

function Header(props) {
  return (<NavBar
    mode="light"
    icon={<Icon type="left" />}
    onLeftClick={() => props.history.go(-1)}
  >
    {props.title}
  </NavBar>)
}
Header.propTypes = {
  title: PropTypes.string.isRequired
}

export default withRouter(Header)